import Mock from 'mockjs'
import { CONSTANT_OBJ } from '@/utils/constant'
let baseURL
let locationHref = `http://${window.location.hostname}`
if (CONSTANT_OBJ.ENV !== 'prodMaster') {
  baseURL = CONSTANT_OBJ.URL + CONSTANT_OBJ.PREFIX + '/esale-user'
  // baseURL = URL
} else {
  baseURL = locationHref + CONSTANT_OBJ.PREFIX + '/esale-user'
}
// 产品列表查询
Mock.mock(`${baseURL}/v1/api/esale-backend/product/queryByCondition`, function () {
  return {
    ...CONSTANT_OBJ.MOCK_RESPONSE,
    data: {
      total: 2,
      list: [
        { productId: '1', productName: '即享金', productNo: 101 },
        { productId: '2', productName: '即享贷', productNo: 102 }
      ]
    }
  }
})
// 通过ID查询申请件基本信息
Mock.mock(`${baseURL}/v1/api/esale-case/case/basic/queryById/1`, function () {
  return {
    ...CONSTANT_OBJ.MOCK_RESPONSE,
    data: {
      caseId: '1',
      applyNo: '202206140707546',
      customerName: '小王王',
      acceptorNo: '23243232321',
      idNbr: '445111********2341',
      customerPhone: '185****1723',
      caseStatus: '主任审批',
      productType: '1',
      acceptorName: 'wew',
      acceptorOrgName: 'ewewe'
    }
  }
})
